<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="clr-namespace:MaterialDesignThemes.Wpf;assembly=MaterialDesignThemes.Wpf"
    xmlns:converters="clr-namespace:MaterialDesignThemes.Wpf.Converters;assembly=MaterialDesignThemes.Wpf"
    xmlns:transitions="clr-namespace:MaterialDesignThemes.Wpf.Transitions;assembly=MaterialDesignThemes.Wpf"
    xmlns:system="clr-namespace:System;assembly=mscorlib">

  <ResourceDictionary.MergedDictionaries>
    <ResourceDictionary Source="../Brushes/MaterialDesign/MaterialDesignTheme.Theme.xaml"/>
  </ResourceDictionary.MergedDictionaries>

  <!-- set up default styles for our custom Material Design in XAML Toolkit controls -->
  <!--<Style TargetType="{x:Type local:Clock}" BasedOn="{StaticResource MaterialDesignClock}" />
    <Style TargetType="{x:Type local:PopupBox}" BasedOn="{StaticResource MaterialDesignPopupBox}" />
    <Style TargetType="{x:Type local:TimePicker}" BasedOn="{StaticResource MaterialDesignTimePicker}" />-->

  <converters:BrushToRadialGradientBrushConverter x:Key="BrushToRadialGradientBrushConverter" />
  <converters:DrawerOffsetConverter x:Key="DrawerOffsetConverter" />

  <system:Boolean x:Key="True">True</system:Boolean>

  <Style TargetType="{x:Type local:Ripple}">
    <Setter Property="RecognizesAccessKey" Value="False" />
    <Setter Property="HorizontalAlignment" Value="Stretch" />
    <Setter Property="VerticalAlignment" Value="Stretch" />
    <Setter Property="Background" Value="Transparent" />
    <Setter Property="IsTabStop" Value="False" />
    <Setter Property="ClipToBounds" Value="{Binding RelativeSource={RelativeSource Self}, Path=(local:RippleAssist.ClipToBounds)}" />
    <Setter Property="Feedback" Value="{Binding RelativeSource={RelativeSource Self}, Path=(local:RippleAssist.Feedback)}" />
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type local:Ripple}">
          <Grid Background="Transparent">
            <VisualStateManager.VisualStateGroups>
              <VisualStateGroup x:Name="CommonStates">
                <VisualStateGroup.Transitions>
                  <VisualTransition From="Normal" To="MousePressed">
                    <Storyboard>
                      <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="ScaleX" Storyboard.TargetName="ScaleTransform">
                        <EasingDoubleKeyFrame KeyTime="0" Value="0"/>
                        <EasingDoubleKeyFrame KeyTime="0:0:1.2" Value="1">
                          <EasingDoubleKeyFrame.EasingFunction>
                            <SineEase EasingMode="EaseIn" />
                          </EasingDoubleKeyFrame.EasingFunction>
                        </EasingDoubleKeyFrame>
                      </DoubleAnimationUsingKeyFrames>
                      <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="ScaleY" Storyboard.TargetName="ScaleTransform">
                        <EasingDoubleKeyFrame KeyTime="0" Value="0"/>
                        <EasingDoubleKeyFrame KeyTime="0:0:1.2" Value="1">
                          <EasingDoubleKeyFrame.EasingFunction>
                            <SineEase EasingMode="EaseIn" />
                          </EasingDoubleKeyFrame.EasingFunction>
                        </EasingDoubleKeyFrame>
                      </DoubleAnimationUsingKeyFrames>
                      <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity" Storyboard.TargetName="ClickEllipse">
                        <EasingDoubleKeyFrame KeyTime="0" Value="0"/>
                        <EasingDoubleKeyFrame KeyTime="0:0:0.05" Value=".26"/>
                      </DoubleAnimationUsingKeyFrames>
                    </Storyboard>
                  </VisualTransition>
                  <VisualTransition From="MousePressed" To="MouseOut">
                    <Storyboard>
                      <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="ScaleX" Storyboard.TargetName="ScaleTransform">
                        <EasingDoubleKeyFrame KeyTime="0:0:0.12" Value="0">
                          <EasingDoubleKeyFrame.EasingFunction>
                            <SineEase EasingMode="EaseIn" />
                          </EasingDoubleKeyFrame.EasingFunction>
                        </EasingDoubleKeyFrame>
                      </DoubleAnimationUsingKeyFrames>
                      <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="ScaleY" Storyboard.TargetName="ScaleTransform">
                        <EasingDoubleKeyFrame KeyTime="0:0:0.12" Value="0">
                          <EasingDoubleKeyFrame.EasingFunction>
                            <SineEase EasingMode="EaseIn" />
                          </EasingDoubleKeyFrame.EasingFunction>
                        </EasingDoubleKeyFrame>
                      </DoubleAnimationUsingKeyFrames>
                      <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity" Storyboard.TargetName="ClickEllipse">
                        <EasingDoubleKeyFrame KeyTime="0:0:0.12" Value="0"/>
                      </DoubleAnimationUsingKeyFrames>
                    </Storyboard>
                  </VisualTransition>
                  <VisualTransition From="MousePressed" To="Normal">
                    <Storyboard>
                      <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="ScaleX" Storyboard.TargetName="ScaleTransform">
                        <EasingDoubleKeyFrame KeyTime="0:0:0.30" Value="1" x:Name="MousePressedToNormalScaleXKeyFrame"/>
                        <EasingDoubleKeyFrame KeyTime="0:0:0.50" Value="1"/>
                        <EasingDoubleKeyFrame KeyTime="0:0:0.50" Value="0"/>
                      </DoubleAnimationUsingKeyFrames>
                      <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="ScaleY" Storyboard.TargetName="ScaleTransform">
                        <EasingDoubleKeyFrame KeyTime="0:0:0.30" Value="1" x:Name="MousePressedToNormalScaleYKeyFrame"/>
                        <EasingDoubleKeyFrame KeyTime="0:0:0.50" Value="1"/>
                        <EasingDoubleKeyFrame KeyTime="0:0:0.50" Value="0"/>
                      </DoubleAnimationUsingKeyFrames>
                      <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity" Storyboard.TargetName="ClickEllipse">
                        <EasingDoubleKeyFrame KeyTime="0:0:0.05" Value=".26"/>
                        <EasingDoubleKeyFrame KeyTime="0:0:0.30" Value=".26"/>
                        <EasingDoubleKeyFrame KeyTime="0:0:0.50" Value="0">
                          <EasingDoubleKeyFrame.EasingFunction>
                            <SineEase EasingMode="EaseOut" />
                          </EasingDoubleKeyFrame.EasingFunction>
                        </EasingDoubleKeyFrame>
                      </DoubleAnimationUsingKeyFrames>
                    </Storyboard>
                  </VisualTransition>
                </VisualStateGroup.Transitions>
                <VisualState x:Name="Normal">
                  <Storyboard>
                    <DoubleAnimation Storyboard.TargetProperty="ScaleX" Storyboard.TargetName="ScaleTransform" To="0"/>
                    <DoubleAnimation Storyboard.TargetProperty="ScaleY" Storyboard.TargetName="ScaleTransform" To="0"/>
                    <DoubleAnimation Storyboard.TargetProperty="Opacity" Storyboard.TargetName="ClickEllipse" To="0"/>
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="MousePressed">
                  <Storyboard>
                    <DoubleAnimation Storyboard.TargetProperty="ScaleX" Storyboard.TargetName="ScaleTransform" To="1"/>
                    <DoubleAnimation Storyboard.TargetProperty="ScaleY" Storyboard.TargetName="ScaleTransform" To="1"/>
                    <DoubleAnimation Storyboard.TargetProperty="Opacity" Storyboard.TargetName="ClickEllipse" To="0.26"/>
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="MouseOut">
                  <Storyboard>
                    <DoubleAnimation Storyboard.TargetProperty="ScaleX" Storyboard.TargetName="ScaleTransform" To="0"/>
                    <DoubleAnimation Storyboard.TargetProperty="ScaleY" Storyboard.TargetName="ScaleTransform" To="0"/>
                    <DoubleAnimation Storyboard.TargetProperty="Opacity" Storyboard.TargetName="ClickEllipse" To="0"/>
                  </Storyboard>
                </VisualState>
              </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>

            <Canvas IsHitTestVisible="False" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
              <Ellipse x:Name="ClickEllipse" Fill="{TemplateBinding Feedback}" Opacity="0"
                       Width="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=RippleSize}"
                       Height="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=RippleSize}"
                       Canvas.Left="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=RippleX}"
                       Canvas.Top="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=RippleY}"
                       RenderTransformOrigin=".5,.5">
                <Ellipse.RenderTransform>
                  <TransformGroup>
                    <ScaleTransform x:Name="ScaleTransform" ScaleX="0" ScaleY="0" />
                    <SkewTransform/>
                    <RotateTransform/>
                    <TranslateTransform x:Name="TranslateTransform"/>
                  </TransformGroup>
                </Ellipse.RenderTransform>
              </Ellipse>
            </Canvas>
            <ContentPresenter Content="{TemplateBinding Content}"
                              ContentStringFormat="{TemplateBinding ContentStringFormat}"
                              ContentTemplate="{TemplateBinding ContentTemplate}"
                              ContentTemplateSelector="{TemplateBinding ContentTemplateSelector}"
                              Margin="{TemplateBinding Padding}"
                              HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                              VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                              RecognizesAccessKey="{TemplateBinding RecognizesAccessKey}"
                              SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
          </Grid>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <Style TargetType="{x:Type local:Underline}">
    <Setter Property="Background" Value="{DynamicResource MidContrastPrimaryBrush}"/>
    <Setter Property="SnapsToDevicePixels" Value="True"/>
    <Setter Property="HorizontalAlignment" Value="Stretch"/>
    <Setter Property="VerticalAlignment" Value="Bottom"/>
    <Setter Property="Height" Value="2"/>
    <Setter Property="IsTabStop" Value="False"/>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type local:Underline}">
          <ControlTemplate.Resources>
            <CircleEase x:Key="UnderlineEasingFunction" EasingMode="EaseOut"/>
          </ControlTemplate.Resources>
          <Border x:Name="UnderlineBorder"
                  Background="{TemplateBinding Background}"
                  CornerRadius="{TemplateBinding CornerRadius}"
                  IsHitTestVisible="False"
                  Height="{TemplateBinding Height}"
                  VerticalAlignment="{TemplateBinding VerticalAlignment}"
                  HorizontalAlignment="{TemplateBinding HorizontalAlignment}"
                  SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
                  RenderTransformOrigin="0.5,0.5">
            <VisualStateManager.VisualStateGroups>
              <VisualStateGroup x:Name="ActivationStates">
                <VisualStateGroup.Transitions>
                  <VisualTransition From="Inactive" To="Active">
                    <Storyboard>
                      <DoubleAnimation Storyboard.TargetName="ScaleTransform"
                                       Storyboard.TargetProperty="ScaleX"
                                       Duration="0:0:0.3"
                                       EasingFunction="{StaticResource UnderlineEasingFunction}"
                                       To="1"/>
                    </Storyboard>
                  </VisualTransition>
                  <VisualTransition From="Active" To="Inactive">
                    <Storyboard>
                      <DoubleAnimation Storyboard.TargetName="ScaleTransform"
                                       Storyboard.TargetProperty="ScaleX"
                                       Duration="0:0:0.3"
                                       EasingFunction="{StaticResource UnderlineEasingFunction}"
                                       To="0"/>
                    </Storyboard>
                  </VisualTransition>
                </VisualStateGroup.Transitions>
                <VisualState x:Name="Active">
                  <Storyboard>
                    <DoubleAnimation Storyboard.TargetName="ScaleTransform"
                                     Storyboard.TargetProperty="ScaleX"
                                     Duration="0"
                                     To="1"/>
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="Inactive">
                  <Storyboard>
                    <DoubleAnimation Storyboard.TargetName="ScaleTransform"
                                     Storyboard.TargetProperty="ScaleX"
                                     Duration="0"
                                     To="0"/>
                  </Storyboard>
                </VisualState>
              </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <Border.RenderTransform>
              <ScaleTransform ScaleX="0" ScaleY="1" x:Name="ScaleTransform" />
            </Border.RenderTransform>
          </Border>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <Style TargetType="{x:Type local:MaterialDateDisplay}">
    <Setter Property="Background" Value="Transparent" />
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type local:MaterialDateDisplay}">
          <Border Background="{TemplateBinding Background}"
                  BorderBrush="{TemplateBinding BorderBrush}"
                  BorderThickness="{TemplateBinding BorderThickness}">
            <StackPanel Orientation="Vertical"
                        Margin="0">
              <TextBlock x:Name="ComponentThreeTextBlock"
                         Text="{TemplateBinding ComponentThreeContent}"
                         HorizontalAlignment="Left"
                         FontSize="15" FontWeight="Normal" />
              <StackPanel x:Name="ComponentOneTwoWrapper" Orientation="Horizontal"
                          HorizontalAlignment="Left">
                <TextBlock Text="{TemplateBinding ComponentTwoContent}" FontSize="30" FontWeight="Normal" />
                <TextBlock Text="{TemplateBinding ComponentOneContent}" Margin="10 0 0 0" FontSize="30" FontWeight="Normal" />
              </StackPanel>
            </StackPanel>
          </Border>
          <ControlTemplate.Triggers>
            <Trigger Property="IsDayInFirstComponent" Value="True">
              <Setter TargetName="ComponentThreeTextBlock" Property="Opacity" Value=".56"/>
            </Trigger>
            <Trigger Property="IsEnabled" Value="False">
              <Setter TargetName="ComponentThreeTextBlock" Property="Opacity" Value="1"/>
              <Setter TargetName="ComponentOneTwoWrapper" Property="Opacity" Value="{StaticResource DisabledOpacity}"/>
            </Trigger>
          </ControlTemplate.Triggers>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <Style TargetType="{x:Type local:ListSortDirectionIndicator}">
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type local:ListSortDirectionIndicator}">
          <Viewbox Margin="0,0,0,0" >
            <VisualStateManager.VisualStateGroups>
              <VisualStateGroup x:Name="Direction">
                <VisualStateGroup.Transitions>
                  <VisualTransition From="None" GeneratedDuration="0" To="Ascending">
                    <VisualTransition.GeneratedEasingFunction>
                      <CubicEase EasingMode="EaseOut"/>
                    </VisualTransition.GeneratedEasingFunction>
                    <Storyboard>
                      <DoubleAnimation Duration="0:0:0.2" To="1" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)" Storyboard.TargetName="path"/>
                      <DoubleAnimation Duration="0:0:0.2" To="90" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)" Storyboard.TargetName="path" BeginTime="0:0:0.2"/>
                    </Storyboard>
                  </VisualTransition>
                  <VisualTransition From="None" GeneratedDuration="0" To="Descending">
                    <VisualTransition.GeneratedEasingFunction>
                      <CubicEase EasingMode="EaseOut"/>
                    </VisualTransition.GeneratedEasingFunction>
                    <Storyboard>
                      <DoubleAnimation Duration="0:0:0.2" To="1" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)" Storyboard.TargetName="path"/>
                      <DoubleAnimation Duration="0:0:0.2" To="-90" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)" Storyboard.TargetName="path" BeginTime="0:0:0.2">
                        <DoubleAnimation.EasingFunction>
                          <CubicEase EasingMode="EaseOut"/>
                        </DoubleAnimation.EasingFunction>
                      </DoubleAnimation>
                    </Storyboard>
                  </VisualTransition>
                  <VisualTransition From="Ascending" GeneratedDuration="0" To="Descending">
                    <VisualTransition.GeneratedEasingFunction>
                      <CubicEase EasingMode="EaseOut"/>
                    </VisualTransition.GeneratedEasingFunction>
                    <Storyboard>
                      <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)" Storyboard.TargetName="path">
                        <DoubleAnimation.EasingFunction>
                          <CubicEase EasingMode="EaseOut"/>
                        </DoubleAnimation.EasingFunction>
                      </DoubleAnimation>
                      <DoubleAnimation Duration="0:0:0.2" To="-90" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)" Storyboard.TargetName="path" From="90"/>
                    </Storyboard>
                  </VisualTransition>
                  <VisualTransition From="Ascending" GeneratedDuration="0" To="None">
                    <VisualTransition.GeneratedEasingFunction>
                      <CubicEase EasingMode="EaseOut"/>
                    </VisualTransition.GeneratedEasingFunction>
                    <Storyboard>
                      <DoubleAnimation Duration="0:0:0.2" To="0" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)" Storyboard.TargetName="path"/>
                      <DoubleAnimation Duration="0" To="90" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)" Storyboard.TargetName="path"/>
                      <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)" Storyboard.TargetName="path">
                        <EasingDoubleKeyFrame KeyTime="0" Value="1"/>
                        <EasingDoubleKeyFrame KeyTime="0:0:0.2" Value="0"/>
                      </DoubleAnimationUsingKeyFrames>
                    </Storyboard>
                  </VisualTransition>
                  <VisualTransition From="Descending" GeneratedDuration="0" To="Ascending">
                    <Storyboard>
                      <DoubleAnimation Duration="0:0:0.2" To="90" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)" Storyboard.TargetName="path" From="-90"/>
                    </Storyboard>
                  </VisualTransition>
                  <VisualTransition From="Descending" GeneratedDuration="0" To="None">
                    <Storyboard>
                      <DoubleAnimation Duration="0" To="-90" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)" Storyboard.TargetName="path"/>
                      <DoubleAnimation Duration="0:0:0.2" To="0" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)" Storyboard.TargetName="path"/>
                      <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)" Storyboard.TargetName="path">
                        <EasingDoubleKeyFrame KeyTime="0" Value="1"/>
                        <EasingDoubleKeyFrame KeyTime="0:0:0.2" Value="0"/>
                      </DoubleAnimationUsingKeyFrames>
                    </Storyboard>
                  </VisualTransition>
                </VisualStateGroup.Transitions>
                <VisualState x:Name="None">
                  <Storyboard>
                    <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)" Storyboard.TargetName="path">
                      <EasingDoubleKeyFrame KeyTime="0" Value="0"/>
                    </DoubleAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="Ascending">
                  <Storyboard>
                    <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)" Storyboard.TargetName="path">
                      <EasingDoubleKeyFrame KeyTime="0" Value="1"/>
                    </DoubleAnimationUsingKeyFrames>
                    <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)" Storyboard.TargetName="path">
                      <EasingDoubleKeyFrame KeyTime="0" Value="90"/>
                    </DoubleAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="Descending">
                  <Storyboard>
                    <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)" Storyboard.TargetName="path">
                      <EasingDoubleKeyFrame KeyTime="0" Value="-90"/>
                    </DoubleAnimationUsingKeyFrames>
                    <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)" Storyboard.TargetName="path">
                      <EasingDoubleKeyFrame KeyTime="0" Value="1"/>
                    </DoubleAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
              </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <Path x:Name="path" Data="M4,11V13H16L10.5,18.5L11.92,19.92L19.84,12L11.92,4.08L10.5,5.5L16,11H4Z" Fill="{TemplateBinding Foreground}"
                        RenderTransformOrigin="0.5,0.5" Height="24" Stretch="Fill" Width="24" >
              <Path.RenderTransform>
                <TransformGroup>
                  <ScaleTransform ScaleY="0"/>
                  <SkewTransform/>
                  <RotateTransform/>
                  <TranslateTransform/>
                </TransformGroup>
              </Path.RenderTransform>
            </Path>
          </Viewbox>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <Style x:Key="MaterialDesignColorZone" TargetType="{x:Type local:ColorZone}">
    <Style.Resources>
      <converters:ShadowEdgeConverter x:Key="ShadowEdgeConverter" />
    </Style.Resources>
    <Setter Property="Background" Value="{DynamicResource MaterialDesignPaper}" />
    <Setter Property="Foreground" Value="{DynamicResource MaterialDesignBody}" />
    <Setter Property="HorizontalContentAlignment" Value="Stretch" />
    <Setter Property="VerticalContentAlignment" Value="Stretch" />
    <Setter Property="VerticalAlignment" Value="Top" />
    <Setter Property="IsTabStop" Value="False" />
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type local:ColorZone}">
          <Grid Background="Transparent">
            <Grid.OpacityMask>
              <MultiBinding Converter="{StaticResource ShadowEdgeConverter}">
                <Binding RelativeSource="{RelativeSource TemplatedParent}" Path="ActualWidth"/>
                <Binding RelativeSource="{RelativeSource TemplatedParent}" Path="ActualHeight"/>
                <Binding RelativeSource="{RelativeSource TemplatedParent}" Path="(local:ShadowAssist.ShadowDepth)" />
                <Binding RelativeSource="{RelativeSource TemplatedParent}" Path="(local:ShadowAssist.ShadowEdges)" />
              </MultiBinding>
            </Grid.OpacityMask>
            <AdornerDecorator CacheMode="{Binding RelativeSource={RelativeSource Self}, Path=(local:ShadowAssist.CacheMode)}">
              <Border Background="{TemplateBinding Background}"
                      CornerRadius="{TemplateBinding CornerRadius}"
                      Effect="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(local:ShadowAssist.ShadowDepth), Converter={x:Static converters:ShadowConverter.Instance}}">
              </Border>
            </AdornerDecorator>
            <Border Background="{TemplateBinding Background}"
                    BorderBrush="{TemplateBinding BorderBrush}"
                    BorderThickness="{TemplateBinding BorderThickness}"
                    CornerRadius="{TemplateBinding CornerRadius}"
                    ClipToBounds="True">
              <ContentPresenter Content="{TemplateBinding Content}"
                                ContentTemplate="{TemplateBinding ContentTemplate}"
                                TextElement.Foreground="{TemplateBinding Foreground}"
                                RecognizesAccessKey="False"
                                Cursor="{TemplateBinding Cursor}"
                                Margin="{TemplateBinding Padding}"
                                HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
            </Border>
          </Grid>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
    <Style.Triggers>
      <Trigger Property="Mode" Value="Inverted">
        <Setter Property="Background" Value="{DynamicResource MaterialDesignBody}" />
        <Setter Property="Foreground" Value="{DynamicResource MaterialDesignPaper}" />
      </Trigger>
      <Trigger Property="Mode" Value="PrimaryLight">
        <Setter Property="Background" Value="{DynamicResource PrimaryHueLightBrush}" />
        <Setter Property="Foreground" Value="{DynamicResource PrimaryHueLightForegroundBrush}" />
      </Trigger>
      <Trigger Property="Mode" Value="PrimaryMid">
        <Setter Property="Background" Value="{DynamicResource PrimaryHueMidBrush}" />
        <Setter Property="Foreground" Value="{DynamicResource PrimaryHueMidForegroundBrush}" />
      </Trigger>
      <Trigger Property="Mode" Value="PrimaryDark">
        <Setter Property="Background" Value="{DynamicResource PrimaryHueDarkBrush}" />
        <Setter Property="Foreground" Value="{DynamicResource PrimaryHueDarkForegroundBrush}" />
      </Trigger>
      <Trigger Property="Mode" Value="Accent">
        <Setter Property="Background" Value="{DynamicResource SecondaryAccentBrush}" />
        <Setter Property="Foreground" Value="{DynamicResource SecondaryAccentForegroundBrush}" />
      </Trigger>
      <Trigger Property="Mode" Value="Light">
        <Setter Property="Background" Value="{DynamicResource MaterialDesignLightBackground}" />
        <Setter Property="Foreground" Value="{DynamicResource MaterialDesignLightForeground}" />
      </Trigger>
      <Trigger Property="Mode" Value="Dark">
        <Setter Property="Background" Value="{DynamicResource MaterialDesignDarkBackground}" />
        <Setter Property="Foreground" Value="{DynamicResource MaterialDesignDarkForeground}" />
      </Trigger>
    </Style.Triggers>
  </Style>

  <Style x:Key="WizardExtendedHeaderColorZone" BasedOn="{StaticResource MaterialDesignColorZone}" TargetType="{x:Type local:ColorZone}">
    <Setter Property="Background" Value="{DynamicResource PrimaryHueMidLightBrush}" />
    <Setter Property="Foreground" Value="{DynamicResource PrimaryHueMidLightForegroundBrush}" />
    <Setter Property="Padding" Value="12,0,12,4"/>
    <Setter Property="Margin" Value="-1,0"/>
  </Style>

  <Style x:Key="{x:Type local:ColorZone}" BasedOn="{StaticResource MaterialDesignColorZone}" TargetType="{x:Type local:ColorZone}"/>

  <SolidColorBrush x:Key="BlackBackground" Color="Black" />

  <Style TargetType="{x:Type local:DrawerHost}">
    <Setter Property="local:ShadowAssist.ShadowDepth" Value="Depth3" />
    <Setter Property="ClipToBounds" Value="True" />
    <Setter Property="LeftDrawerBackground" Value="{DynamicResource MaterialDesignPaper}" />
    <Setter Property="TopDrawerBackground" Value="{DynamicResource MaterialDesignPaper}" />
    <Setter Property="RightDrawerBackground" Value="{DynamicResource MaterialDesignPaper}" />
    <Setter Property="BottomDrawerBackground" Value="{DynamicResource MaterialDesignPaper}" />
    <Setter Property="IsTabStop" Value="False" />
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type local:DrawerHost}">
          <Border BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}">
            <VisualStateManager.VisualStateGroups>
              <VisualStateGroup x:Name="AllDrawers">
                <VisualStateGroup.Transitions>
                  <VisualTransition From="AllClosed" To="AnyOpen">
                    <Storyboard>
                      <BooleanAnimationUsingKeyFrames Storyboard.TargetName="PART_ContentCover" Storyboard.TargetProperty="IsHitTestVisible">
                        <DiscreteBooleanKeyFrame Value="True" KeyTime="0" />
                      </BooleanAnimationUsingKeyFrames>
                      <BooleanAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="IsEnabled">
                        <DiscreteBooleanKeyFrame Value="False" KeyTime="0" />
                      </BooleanAnimationUsingKeyFrames>
                      <DoubleAnimationUsingKeyFrames Storyboard.TargetName="PART_ContentCover" Storyboard.TargetProperty="Opacity">
                        <EasingDoubleKeyFrame Value="0" KeyTime="0" />
                        <EasingDoubleKeyFrame Value="{StaticResource DisabledOpacity}" KeyTime="0:0:0.3">
                          <EasingDoubleKeyFrame.EasingFunction>
                            <SineEase EasingMode="EaseOut" />
                          </EasingDoubleKeyFrame.EasingFunction>
                        </EasingDoubleKeyFrame>
                      </DoubleAnimationUsingKeyFrames>
                      <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_ContentCover"
                                                     Storyboard.TargetProperty="Background">
                        <DiscreteObjectKeyFrame Value="{StaticResource BlackBackground}" KeyTime="0" />
                      </ObjectAnimationUsingKeyFrames>
                    </Storyboard>
                  </VisualTransition>
                  <VisualTransition From="AnyOpen" To="AllClosed">
                    <Storyboard>
                      <DoubleAnimationUsingKeyFrames Storyboard.TargetName="PART_ContentCover" Storyboard.TargetProperty="Opacity">
                        <EasingDoubleKeyFrame Value="{StaticResource DisabledOpacity}" KeyTime="0" />
                        <EasingDoubleKeyFrame Value="0" KeyTime="0:0:0.3">
                          <EasingDoubleKeyFrame.EasingFunction>
                            <SineEase EasingMode="EaseInOut" />
                          </EasingDoubleKeyFrame.EasingFunction>
                        </EasingDoubleKeyFrame>
                      </DoubleAnimationUsingKeyFrames>
                      <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_ContentCover"
                                                     Storyboard.TargetProperty="Background">
                        <DiscreteObjectKeyFrame Value="{x:Null}" KeyTime="0:0:0.3" />
                      </ObjectAnimationUsingKeyFrames>
                    </Storyboard>
                  </VisualTransition>
                </VisualStateGroup.Transitions>
                <VisualState x:Name="AnyOpen">
                  <Storyboard>
                    <DoubleAnimation Storyboard.TargetName="PART_ContentCover" Storyboard.TargetProperty="Opacity"
                                         To=".56" Duration="0" />
                    <BooleanAnimationUsingKeyFrames Storyboard.TargetName="PART_ContentCover" Storyboard.TargetProperty="IsHitTestVisible">
                      <DiscreteBooleanKeyFrame Value="True" KeyTime="0" />
                    </BooleanAnimationUsingKeyFrames>
                    <BooleanAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="IsEnabled">
                      <DiscreteBooleanKeyFrame Value="False" KeyTime="0" />
                    </BooleanAnimationUsingKeyFrames>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_ContentCover"
                                                       Storyboard.TargetProperty="Background">
                      <DiscreteObjectKeyFrame Value="{StaticResource BlackBackground}" KeyTime="0" />
                    </ObjectAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="AllClosed">
                  <Storyboard>
                    <DoubleAnimation Storyboard.TargetName="PART_ContentCover" Storyboard.TargetProperty="Opacity"
                                     To="0" />
                    <BooleanAnimationUsingKeyFrames Storyboard.TargetName="PART_ContentCover" Storyboard.TargetProperty="IsHitTestVisible">
                      <DiscreteBooleanKeyFrame Value="False" />
                    </BooleanAnimationUsingKeyFrames>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_ContentCover"
                                                   Storyboard.TargetProperty="Background">
                      <DiscreteObjectKeyFrame Value="{x:Null}" />
                    </ObjectAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
              </VisualStateGroup>
              <VisualStateGroup x:Name="LeftDrawer">
                <VisualStateGroup.Transitions>
                  <VisualTransition From="LeftDrawerClosed" To="LeftDrawerOpen">
                    <Storyboard>
                      <ThicknessAnimationUsingKeyFrames Storyboard.TargetProperty="Margin" Storyboard.TargetName="PART_LeftDrawer">
                        <EasingThicknessKeyFrame Value="0" KeyTime="0:0:0.4">
                          <EasingThicknessKeyFrame.EasingFunction>
                            <SineEase EasingMode="EaseOut" />
                          </EasingThicknessKeyFrame.EasingFunction>
                        </EasingThicknessKeyFrame>
                      </ThicknessAnimationUsingKeyFrames>
                      <DoubleAnimation Storyboard.TargetName="LeftDrawerShadow" Storyboard.TargetProperty="Opacity" From="0" To="1" Duration="0:0:0.04" />
                    </Storyboard>
                  </VisualTransition>
                  <VisualTransition From="LeftDrawerOpen" To="LeftDrawerClosed">
                    <Storyboard>
                      <ThicknessAnimation Storyboard.TargetProperty="Margin" Storyboard.TargetName="PART_LeftDrawer" Duration="0:0:0.4">
                        <ThicknessAnimation.EasingFunction>
                          <SineEase EasingMode="EaseOut" />
                        </ThicknessAnimation.EasingFunction>
                      </ThicknessAnimation>
                      <DoubleAnimationUsingKeyFrames Storyboard.TargetName="LeftDrawerShadow" Storyboard.TargetProperty="Opacity">
                        <EasingDoubleKeyFrame Value="1" KeyTime="0:0:0.36" />
                        <EasingDoubleKeyFrame Value="0" KeyTime="0:0:0.4">
                          <EasingDoubleKeyFrame.EasingFunction>
                            <SineEase EasingMode="EaseOut" />
                          </EasingDoubleKeyFrame.EasingFunction>
                        </EasingDoubleKeyFrame>
                      </DoubleAnimationUsingKeyFrames>
                    </Storyboard>
                  </VisualTransition>
                </VisualStateGroup.Transitions>
                <VisualState x:Name="LeftDrawerOpen">
                  <Storyboard>
                    <DoubleAnimation Storyboard.TargetName="LeftDrawerShadow" Storyboard.TargetProperty="Opacity" From="0" To="1" Duration="0" />
                    <ThicknessAnimation Storyboard.TargetProperty="Margin" Storyboard.TargetName="PART_LeftDrawer" To="0" Duration="0"/>
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="LeftDrawerClosed">
                  <Storyboard>
                    <DoubleAnimation Storyboard.TargetName="LeftDrawerShadow" Storyboard.TargetProperty="Opacity" From="0" To="0" Duration="0" />
                    <ThicknessAnimation Storyboard.TargetProperty="Margin" Storyboard.TargetName="PART_LeftDrawer" Duration="0"/>
                  </Storyboard>
                </VisualState>
              </VisualStateGroup>
              <VisualStateGroup x:Name="RightDrawer">
                <VisualStateGroup.Transitions>
                  <VisualTransition From="RightDrawerClosed" To="RightDrawerOpen">
                    <Storyboard>
                      <ThicknessAnimationUsingKeyFrames Storyboard.TargetProperty="Margin" Storyboard.TargetName="PART_RightDrawer">
                        <EasingThicknessKeyFrame Value="0" KeyTime="0:0:0.4">
                          <EasingThicknessKeyFrame.EasingFunction>
                            <SineEase EasingMode="EaseOut" />
                          </EasingThicknessKeyFrame.EasingFunction>
                        </EasingThicknessKeyFrame>
                      </ThicknessAnimationUsingKeyFrames>
                      <DoubleAnimation Storyboard.TargetName="RightDrawerShadow" Storyboard.TargetProperty="Opacity" From="0" To="1" Duration="0:0:0.04" />
                    </Storyboard>
                  </VisualTransition>
                  <VisualTransition From="RightDrawerOpen" To="RightDrawerClosed">
                    <Storyboard>
                      <ThicknessAnimation Storyboard.TargetProperty="Margin" Storyboard.TargetName="PART_RightDrawer" Duration="0:0:0.4">
                        <ThicknessAnimation.EasingFunction>
                          <SineEase EasingMode="EaseOut" />
                        </ThicknessAnimation.EasingFunction>
                      </ThicknessAnimation>
                      <DoubleAnimationUsingKeyFrames Storyboard.TargetName="RightDrawerShadow" Storyboard.TargetProperty="Opacity">
                        <EasingDoubleKeyFrame Value="1" KeyTime="0:0:0.36" />
                        <EasingDoubleKeyFrame Value="0" KeyTime="0:0:0.4">
                          <EasingDoubleKeyFrame.EasingFunction>
                            <SineEase EasingMode="EaseOut" />
                          </EasingDoubleKeyFrame.EasingFunction>
                        </EasingDoubleKeyFrame>
                      </DoubleAnimationUsingKeyFrames>
                    </Storyboard>
                  </VisualTransition>
                </VisualStateGroup.Transitions>
                <VisualState x:Name="RightDrawerOpen">
                  <Storyboard>
                    <DoubleAnimation Storyboard.TargetName="RightDrawerShadow" Storyboard.TargetProperty="Opacity" From="0" To="1" Duration="0" />
                    <ThicknessAnimation Storyboard.TargetProperty="Margin" Storyboard.TargetName="PART_RightDrawer" To="0 0 0 0" Duration="0"/>
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="RightDrawerClosed">
                  <Storyboard>
                    <DoubleAnimation Storyboard.TargetName="RightDrawerShadow" Storyboard.TargetProperty="Opacity" From="0" To="0" Duration="0" />
                    <ThicknessAnimation Storyboard.TargetProperty="Margin" Storyboard.TargetName="PART_RightDrawer" Duration="0"/>
                  </Storyboard>
                </VisualState>
              </VisualStateGroup>
              <VisualStateGroup x:Name="TopDrawer">
                <VisualStateGroup.Transitions>
                  <VisualTransition From="TopDrawerClosed" To="TopDrawerOpen">
                    <Storyboard>
                      <ThicknessAnimationUsingKeyFrames Storyboard.TargetProperty="Margin" Storyboard.TargetName="PART_TopDrawer">
                        <EasingThicknessKeyFrame Value="0" KeyTime="0:0:0.4">
                          <EasingThicknessKeyFrame.EasingFunction>
                            <SineEase EasingMode="EaseOut" />
                          </EasingThicknessKeyFrame.EasingFunction>
                        </EasingThicknessKeyFrame>
                      </ThicknessAnimationUsingKeyFrames>
                      <DoubleAnimation Storyboard.TargetName="TopDrawerShadow" Storyboard.TargetProperty="Opacity" From="0" To="1" Duration="0:0:0.04" />
                    </Storyboard>
                  </VisualTransition>
                  <VisualTransition From="TopDrawerOpen" To="TopDrawerClosed">
                    <Storyboard>
                      <ThicknessAnimation Storyboard.TargetProperty="Margin" Storyboard.TargetName="PART_TopDrawer" Duration="0:0:0.4">
                        <ThicknessAnimation.EasingFunction>
                          <SineEase EasingMode="EaseOut" />
                        </ThicknessAnimation.EasingFunction>
                      </ThicknessAnimation>
                      <DoubleAnimationUsingKeyFrames Storyboard.TargetName="TopDrawerShadow" Storyboard.TargetProperty="Opacity">
                        <EasingDoubleKeyFrame Value="1" KeyTime="0:0:0.36" />
                        <EasingDoubleKeyFrame Value="0" KeyTime="0:0:0.4">
                          <EasingDoubleKeyFrame.EasingFunction>
                            <SineEase EasingMode="EaseOut" />
                          </EasingDoubleKeyFrame.EasingFunction>
                        </EasingDoubleKeyFrame>
                      </DoubleAnimationUsingKeyFrames>
                    </Storyboard>
                  </VisualTransition>
                </VisualStateGroup.Transitions>
                <VisualState x:Name="TopDrawerOpen">
                  <Storyboard>
                    <DoubleAnimation Storyboard.TargetName="TopDrawerShadow" Storyboard.TargetProperty="Opacity" From="0" To="1" Duration="0" />
                    <ThicknessAnimation Storyboard.TargetProperty="Margin" Storyboard.TargetName="PART_TopDrawer" To="0" Duration="0"/>
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="TopDrawerClosed">
                  <Storyboard>
                    <DoubleAnimation Storyboard.TargetName="TopDrawerShadow" Storyboard.TargetProperty="Opacity" From="0" To="0" Duration="0" />
                    <ThicknessAnimation Storyboard.TargetProperty="Margin" Storyboard.TargetName="PART_TopDrawer" Duration="0"/>
                  </Storyboard>
                </VisualState>
              </VisualStateGroup>
              <VisualStateGroup x:Name="BottomDrawer">
                <VisualStateGroup.Transitions>
                  <VisualTransition From="BottomDrawerClosed" To="BottomDrawerOpen">
                    <Storyboard>
                      <ThicknessAnimationUsingKeyFrames Storyboard.TargetProperty="Margin" Storyboard.TargetName="PART_BottomDrawer">
                        <EasingThicknessKeyFrame Value="0" KeyTime="0:0:0.4">
                          <EasingThicknessKeyFrame.EasingFunction>
                            <SineEase EasingMode="EaseOut" />
                          </EasingThicknessKeyFrame.EasingFunction>
                        </EasingThicknessKeyFrame>
                      </ThicknessAnimationUsingKeyFrames>
                      <DoubleAnimation Storyboard.TargetName="BottomDrawerShadow" Storyboard.TargetProperty="Opacity" From="0" To="1" Duration="0:0:0.04" />
                    </Storyboard>
                  </VisualTransition>
                  <VisualTransition From="BottomDrawerOpen" To="BottomDrawerClosed">
                    <Storyboard>
                      <ThicknessAnimation Storyboard.TargetProperty="Margin" Storyboard.TargetName="PART_BottomDrawer" Duration="0:0:0.4">
                        <ThicknessAnimation.EasingFunction>
                          <SineEase EasingMode="EaseOut" />
                        </ThicknessAnimation.EasingFunction>
                      </ThicknessAnimation>
                      <DoubleAnimationUsingKeyFrames Storyboard.TargetName="BottomDrawerShadow" Storyboard.TargetProperty="Opacity">
                        <EasingDoubleKeyFrame Value="1" KeyTime="0:0:0.36" />
                        <EasingDoubleKeyFrame Value="0" KeyTime="0:0:0.4">
                          <EasingDoubleKeyFrame.EasingFunction>
                            <SineEase EasingMode="EaseOut" />
                          </EasingDoubleKeyFrame.EasingFunction>
                        </EasingDoubleKeyFrame>
                      </DoubleAnimationUsingKeyFrames>
                    </Storyboard>
                  </VisualTransition>
                </VisualStateGroup.Transitions>
                <VisualState x:Name="BottomDrawerOpen">
                  <Storyboard>
                    <DoubleAnimation Storyboard.TargetName="BottomDrawerShadow" Storyboard.TargetProperty="Opacity" From="0" To="1" Duration="0" />
                    <ThicknessAnimation Storyboard.TargetProperty="Margin" Storyboard.TargetName="PART_BottomDrawer" To="0 0 0 0" Duration="0"/>
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="BottomDrawerClosed">
                  <Storyboard>
                    <DoubleAnimation Storyboard.TargetName="BottomDrawerShadow" Storyboard.TargetProperty="Opacity" From="0" To="0" Duration="0" />
                    <ThicknessAnimation Storyboard.TargetProperty="Margin" Storyboard.TargetName="PART_BottomDrawer" Duration="0"/>
                  </Storyboard>
                </VisualState>
              </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <Grid x:Name="RootGrid">
              <AdornerDecorator>
                <ContentPresenter
                        x:Name="ContentPresenter" Opacity="1"
                        Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" ContentStringFormat="{TemplateBinding ContentStringFormat}" />
              </AdornerDecorator>
              <Grid x:Name="PART_ContentCover" Background="{x:Null}" Opacity="0" IsHitTestVisible="False" Focusable="False" />
              <Grid>
                <Grid HorizontalAlignment="Left" VerticalAlignment="Stretch"
                      x:Name="PART_LeftDrawer"
                      Margin="{Binding RelativeSource={RelativeSource Self}, Path=ActualWidth, Converter={StaticResource DrawerOffsetConverter}, ConverterParameter={x:Static Dock.Left}}"
                      Panel.ZIndex="{TemplateBinding LeftDrawerZIndex}">
                  <AdornerDecorator CacheMode="{Binding RelativeSource={RelativeSource Self}, Path=(local:ShadowAssist.CacheMode)}">
                    <Border Effect="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(local:ShadowAssist.ShadowDepth), Converter={x:Static converters:ShadowConverter.Instance}}"
                            Opacity="0"
                            Background="{TemplateBinding LeftDrawerBackground}"
                            x:Name="LeftDrawerShadow">
                    </Border>
                  </AdornerDecorator>
                  <ContentPresenter Content="{TemplateBinding LeftDrawerContent}" ContentTemplate="{TemplateBinding LeftDrawerContentTemplate}" ContentStringFormat="{TemplateBinding LeftDrawerContentStringFormat}"
                                    IsEnabled="{TemplateBinding IsLeftDrawerOpen}"
                                                      />
                </Grid>
                <Grid VerticalAlignment="Stretch" HorizontalAlignment="Right"
                      x:Name="PART_RightDrawer"
                      Margin="{Binding RelativeSource={RelativeSource Self}, Path=ActualWidth, Converter={StaticResource DrawerOffsetConverter}, ConverterParameter={x:Static Dock.Right}}"
                      Panel.ZIndex="{TemplateBinding RightDrawerZIndex}">
                  <AdornerDecorator CacheMode="{Binding RelativeSource={RelativeSource Self}, Path=(local:ShadowAssist.CacheMode)}">
                    <Border Effect="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(local:ShadowAssist.ShadowDepth), Converter={x:Static converters:ShadowConverter.Instance}}"
                            Opacity="0"
                            Background="{TemplateBinding RightDrawerBackground}"
                            x:Name="RightDrawerShadow">
                    </Border>
                  </AdornerDecorator>
                  <ContentPresenter Content="{TemplateBinding RightDrawerContent}" ContentTemplate="{TemplateBinding RightDrawerContentTemplate}" ContentStringFormat="{TemplateBinding RightDrawerContentStringFormat}"
                                    IsEnabled="{TemplateBinding IsRightDrawerOpen}" />
                </Grid>
                <Grid HorizontalAlignment="Stretch" VerticalAlignment="Top"
                      x:Name="PART_TopDrawer"
                      Margin="{Binding RelativeSource={RelativeSource Self}, Path=ActualHeight, Converter={StaticResource DrawerOffsetConverter}, ConverterParameter={x:Static Dock.Top}}"
                      Panel.ZIndex="{TemplateBinding TopDrawerZIndex}">
                  <AdornerDecorator CacheMode="{Binding RelativeSource={RelativeSource Self}, Path=(local:ShadowAssist.CacheMode)}">
                    <Border Effect="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(local:ShadowAssist.ShadowDepth), Converter={x:Static converters:ShadowConverter.Instance}}"
                            Opacity="0"
                            Background="{TemplateBinding TopDrawerBackground}"
                            x:Name="TopDrawerShadow">
                    </Border>
                  </AdornerDecorator>
                  <ContentPresenter Content="{TemplateBinding TopDrawerContent}" ContentTemplate="{TemplateBinding TopDrawerContentTemplate}" ContentStringFormat="{TemplateBinding TopDrawerContentStringFormat}"
                                    IsEnabled="{TemplateBinding IsTopDrawerOpen}" />
                </Grid>
                <Grid VerticalAlignment="Bottom" HorizontalAlignment="Stretch"
                      x:Name="PART_BottomDrawer"
                      Margin="{Binding RelativeSource={RelativeSource Self}, Path=ActualHeight, Converter={StaticResource DrawerOffsetConverter}, ConverterParameter={x:Static Dock.Bottom}}"
                      Panel.ZIndex="{TemplateBinding BottomDrawerZIndex}">
                  <AdornerDecorator CacheMode="{Binding RelativeSource={RelativeSource Self}, Path=(local:ShadowAssist.CacheMode)}">
                    <Border Effect="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(local:ShadowAssist.ShadowDepth), Converter={x:Static converters:ShadowConverter.Instance}}"
                        Opacity="0"
                        Background="{TemplateBinding BottomDrawerBackground}"
                        x:Name="BottomDrawerShadow">
                    </Border>
                  </AdornerDecorator>
                  <ContentPresenter Content="{TemplateBinding BottomDrawerContent}" ContentTemplate="{TemplateBinding BottomDrawerContentTemplate}" ContentStringFormat="{TemplateBinding BottomDrawerContentStringFormat}"
                                    IsEnabled="{TemplateBinding IsBottomDrawerOpen}"/>
                </Grid>
              </Grid>
            </Grid>
          </Border>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <Style x:Key="BasePackIcon" TargetType="{x:Type local:PackIcon}">
    <Setter Property="Height" Value="16" />
    <Setter Property="Width" Value="16" />
    <Setter Property="HorizontalAlignment" Value="Left" />
    <Setter Property="VerticalAlignment" Value="Top" />
    <Setter Property="IsTabStop" Value="False" />
    <Setter Property="FlowDirection" Value="LeftToRight" />
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type local:PackIcon}">
          <Border Background="{TemplateBinding Background}"
                  BorderBrush="{TemplateBinding BorderBrush}"
                  BorderThickness="{TemplateBinding BorderThickness}">
            <Viewbox FlowDirection="{TemplateBinding FlowDirection}">
              <Canvas Width="24" Height="24">
                <Path Data="{Binding Data, RelativeSource={RelativeSource TemplatedParent}}"
                      Fill="{TemplateBinding Foreground}" />
              </Canvas>
            </Viewbox>
          </Border>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <Style x:Key="{x:Type local:PackIcon}" BasedOn="{StaticResource BasePackIcon}" TargetType="{x:Type local:PackIcon}"/>

  <Style TargetType="{x:Type transitions:Transitioner}">
    <Setter Property="ClipToBounds" Value="True" />
    <Setter Property="ItemsPanel">
      <Setter.Value>
        <ItemsPanelTemplate>
          <Grid IsItemsHost="True" />
        </ItemsPanelTemplate>
      </Setter.Value>
    </Setter>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type transitions:Transitioner}">
          <Border Background="{TemplateBinding Background}"
                  BorderBrush="{TemplateBinding BorderBrush}"
                  BorderThickness="{TemplateBinding BorderThickness}">
            <ItemsPresenter x:Name="ItemsPresenter" />
          </Border>
          <ControlTemplate.Triggers>
            <Trigger Property="SelectedIndex" Value="-1">
              <Setter TargetName="ItemsPresenter" Property="Visibility" Value="Hidden" />
            </Trigger>
          </ControlTemplate.Triggers>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <Style TargetType="{x:Type transitions:TransitioningContentBase}">
    <Setter Property="KeyboardNavigation.IsTabStop" Value="False"/>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type transitions:TransitioningContentBase}">
          <Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}"
                  x:Name="Border">
            <ContentPresenter
                    x:Name="ContentPresenter"
                    Margin="{TemplateBinding Padding}"
                    Content="{TemplateBinding ContentControl.Content}"
                    ContentTemplate="{TemplateBinding ContentControl.ContentTemplate}"
                    ContentTemplateSelector="{TemplateBinding ContentControl.ContentTemplateSelector}"
                    ContentStringFormat="{TemplateBinding ContentControl.ContentStringFormat}"
                    RenderTransformOrigin=".5,.5">
              <ContentPresenter.RenderTransform>
                <TransformGroup>
                  <MatrixTransform x:Name="PART_MatrixTransform" />
                  <RotateTransform x:Name="PART_RotateTransform" Angle="0" />
                  <ScaleTransform  x:Name="PART_ScaleTransform" ScaleX="1" ScaleY="1" />
                  <SkewTransform x:Name="PART_SkewTransform" AngleX="0" AngleY="0" />
                  <TranslateTransform x:Name="PART_TranslateTransform" X="0" Y="0" />
                </TransformGroup>
              </ContentPresenter.RenderTransform>
            </ContentPresenter>
          </Border>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <Style TargetType="{x:Type transitions:TransitioningContent}" BasedOn="{StaticResource {x:Type transitions:TransitioningContentBase}}" />

  <Style TargetType="{x:Type transitions:TransitionerSlide}" BasedOn="{StaticResource {x:Type transitions:TransitioningContentBase}}">
    <Setter Property="RenderTransformOrigin" Value=".5,.5" />
    <Setter Property="IsEnabled" Value="False" />
    <Setter Property="Visibility" Value="Hidden" />
    <Style.Triggers>
      <Trigger Property="State" Value="Current">
        <Setter Property="Visibility" Value="Visible" />
        <Setter Property="IsEnabled" Value="True" />
      </Trigger>
      <Trigger Property="State" Value="Previous">
        <Setter Property="Visibility" Value="Visible" />
      </Trigger>
    </Style.Triggers>
  </Style>

</ResourceDictionary>
